Skip to content

Conversation

@ThemeHackers
Copy link
Contributor

This PR fixes a TypeError: object of type 'NoneType' has no len() that occurs when processing PushEvent payloads where the commits key is missing or None.

Changes:
Added a check in
src/gitxray/include/gh_public_events.py
to handle cases where payload.get('commits') returns None.
Defaults commits to an empty list [] to prevent len() from failing.

Verification:
Verified with a reproduction script simulating a PushEvent with missing commits.
Verified by running gitxray against the repository that caused the crash (ThemeHackers/ssf).

Copy link
Contributor

@llavarello llavarello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @ThemeHackers for this, looks good.

@llavarello llavarello merged commit 4892f76 into kulkansecurity:main Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants